<template>
    <div class="home">
        <!-- <van-button type="primary">主要按钮</van-button> -->
        <router-view></router-view>
        <van-tabbar v-model="active">
            <van-tabbar-item to="/principalSheet" icon="wap-home-o">主页</van-tabbar-item>
            <van-tabbar-item to="/publish" icon="add-o">发布</van-tabbar-item>
            <van-tabbar-item to="/my" icon="user-o">我的</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { useRoute } from "vue-router";
let active = ref(0);
let router = useRoute();
// 判断当前导航
let initFun = () => {
    if (router.path == "/principalSheet") {
        active.value = 0;
    }
    if (router.path == "/my") {
        active.value = 2;
    }
};
initFun();
</script>
